/*
 * Copyright 2009 BioTeam Inc
 * 
 * Licensed under License GNU LESSER GENERAL PUBLIC LICENSE version 3.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package net.bioteam.appweb.gwt.apps.clientandserver.user;

import net.bioteam.cloud.cluster.ActiveCluster;
import net.bioteam.cloud.cluster.ClusterData;
import net.bioteam.appweb.gwt.apps.clientandserver.ClusterInfo;
import net.bioteam.appweb.model.ProgramTemplate;
import net.bioteam.appweb.submit.RunStatus;
import net.bioteam.common.user.User;
import net.bioteam.common.user.UserInfo;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface UserActionAsync
{

	public void deletetemplate(String[] ids, AsyncCallback<String> callback);
	
	public void updateTemplates(ProgramTemplate[] runs, AsyncCallback<ProgramTemplate[]> callback);
	
	public void getTemplates(AsyncCallback<ProgramTemplate[]> callback);
	
	public void deleteJobs(String[] ids, AsyncCallback<String> callback);

	
	public void getJobs(int start, int limit, String sort, String direction, AsyncCallback<JobRet> callback);
	public void refreshJob(long id, AsyncCallback<RunStatus> callback);
	public void getAccount(AsyncCallback<User> callback);
	public void changePassword(String oldPw, String newPw, AsyncCallback<User> callback);
	public void changeEmail(String email, AsyncCallback<User> callback);
	public void deleteEc2Info(AsyncCallback<String> callback);
	public void attachEC2Info(UserInfo info, AsyncCallback<User> callback);
	
	
	public void getLoginUser(AsyncCallback<User> callback);
	
	public void updateAccount(User user, AsyncCallback<User> callback);
	
	
	
	public void getActiveCluster(boolean allClusters, AsyncCallback<ActiveCluster[]> callback);
	public void startCluster(ClusterData data, AsyncCallback<ActiveCluster> callback);
	public void killCluster(long id, AsyncCallback<String> callback);
	public void getClusterKey(long id, AsyncCallback<String> callback);

	void killJob(String id, AsyncCallback<String> callback);

	void getClusterHistory(int start, int limit, AsyncCallback<ClusterRet> callback);
	
}
